package ptaTest6;
/*
import java.util.NoSuchElementException;
import java.util.Scanner;


@SuppressWarnings("serial")
class IllegalScoreException extends Exception {
	   public IllegalScoreException (String message) {
	        super(message);
	    }
}
@SuppressWarnings("serial")
class IllegalNameException extends RuntimeException {
	public IllegalNameException (String message){
		super(message);
	}
}


class Student1{
	private String name;
	private int score;
	
	public int getScore() {
		return score;
	}

	public String getName() {
		return name;
	}

	public  int addScore(int score)throws IllegalScoreException {
		if (score < 0 ||score > 100){
			throw new IllegalScoreException("score out of range, score=" + score);
		}
		// TODO Auto-generated method stub
		this.score=score;
		return score;
	}

	public void setName(String name)throws IllegalNameException {
		// TODO Auto-generated method stub
		if (name.toCharArray()[0] >= '0' && name.toCharArray()[0] <= '9')
			throw new IllegalNameException("the first char of name must not be digit, name=" + name);
		this.name =name;
	}

	@Override
	public String toString() {
		return "Student [name=" + name + ", score=" + score + "]";
	}
	
}


public class Test654Re {
	public static void main(String[]args){
		Scanner sc=new Scanner(System.in);
		while(sc.hasNext()){
			if(sc.next().equals("new")){
				try{
					Student1 student = new Student1();
					student.setName(sc.next());			
					student.addScore(sc.nextInt());
					System.out.println(student.toString());
				}catch(NoSuchElementException e){
					System.out.println("java.util.NoSuchElementException");
				}catch(IllegalNameException e){
					System.out.println(e);
				} catch(IllegalScoreException e){
					System.out.println(e);
					}
				}
		}
		sc.close();
		System.out.println("scanner closed");
		}
		

}
*/